import requests
from django.conf import settings


def send_text_message_to_group(text):
    send_text_message(settings.GROUP_ID, text)


def send_text_message(chat_id, text):
    params = dict(
        chat_id=chat_id,
        text=text,
    )
    response = requests.get(settings.API_SEND_TEXT_MESSAGE, params=params)
    if response.status_code != 200:
        return response.text


if __name__ == '__main__':
    send_text_message_to_group('test bot message')
